<?php
/**
 * Created by PhpStorm.
 * User: ls721
 * Date: 2016/10/24 0024
 * Time: 10:25
 */class Model_Image extends PhalApi_Model_NotORM {
    public function getImage($comment_id,$Image_id)
    {
        return $this->getORM()
            ->select('Comment_id as CommentId','Image_id as ImageId','url as URL')
            ->where(array('Comment_id'=>$comment_id,'Image_id'=>$Image_id))
            ->fetch();

    }
    public function getImagesOfComment($comment_id)
    {
        return $this->getORM()
            ->select('Comment_id as CommentId','Image_id as ImageId','url as URL')
            ->where(array('Comment_id'=>$comment_id))
            ->fetchRows();

    }

    protected function getTableName($id) {
        return 'Image';
    }
}